package com.yyg.boot.web;

import com.yyg.boot.entity.Goods;
import com.yyg.boot.entity.User;
import com.yyg.boot.service.GoodsService;
import com.yyg.boot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author 一一哥Sun
 * @Date Created in 2020/4/3
 * @Description Description
 */
@RestController
public class GoodsController {

    @Autowired
    private UserService userService;

    @Autowired
    private GoodsService goodsService;

    @GetMapping(value = "/users")
    public List<User> users() {
        return userService.findAll();
    }

    @GetMapping(value = "/goods")
    public List<Goods> goods() {
        return goodsService.findAll();
    }

}
